<?php
//echo get_pelawat_monthly(2007,01,08); exit;
//$a =  $gDateLocale-> GetShortMonth();
//$a=array("8am","9","10","11","12","13","14","15","16",17,18,19,20);

$a =  $gDateLocale-> GetShortMonth();
$datay=array();

if ( !isset($year) || (''==$year) ) $year = Date('Y');

for ($month=1;$month<=12;$month++) {
	array_push($a,"$month");
	//array_push($datay,get_outing_everymonth($year,$month));
	array_push($datay,rand(3,10));
}

//print_r($datay);exit;
// Create the graph. These two calls are always required
$graph = new Graph(650,300,"auto");	
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);
$graph->xaxis-> SetTickLabels($a);

// Add a drop shadow
//$graph->SetShadow();

// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);

// Create a bar pot
$bplot = new BarPlot($datay);

// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->SetShadow('#aaaaaa');
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
$bplot->value->SetAngle(0);
$bplot->value->SetFormat('%0.0f');
$graph->Add($bplot);

// Setup the titles
//$graph->title->Set("Statistik Outing Mengikut Bulan bagi Tahun $year");
$graph->title->Set("Statistik Program Mengikut Bulan bagi Tahun 2007");
$graph->xaxis->title->Set("Bulan");
//$graph->yaxis->title->Set("Jumlah Pelajar");
$graph->yaxis->title->Set("Jumlah Program");

$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);

$graph->SetBackgroundGradient('blue:1.9','blue:1.9',GRAD_HOR,BGRAD_MARGIN); 

// Display the graph
$graph->Stroke();
?>
